package cn.edu.scau.cmi.lijiongtao.abstractFactory.factory;

import cn.edu.scau.cmi.lijiongtao.abstractFactory.company.PICC;
import cn.edu.scau.cmi.lijiongtao.abstractFactory.company.PingAn;

public abstract class AbstractFactory {
	public static final String body = "驾驶员身体受伤";
	public static final String car = "汽车损坏";
	public static final String casual = "人员伤亡";
	public static final String multiple = "多种事故";
	public static AbstractFactory getInsuranceFactory(String type) {
		AbstractFactory aFactory  = null;
		if(type.equals(AbstractFactory.body)) {aFactory = new BodyInjurFactory();}
		else if(type.equals(AbstractFactory.car)) {aFactory = new CarDamageFactory();}
		else if(type.equals(AbstractFactory.casual)) {aFactory = new CasualtiesFactory();}
		else if(type.equals(AbstractFactory.multiple)) {aFactory = new MultipleAccidentsFactory();}
		return aFactory;
	}
	
	public abstract PICC getPICC();
	public abstract PingAn getPingAn();
}
